package com.ruoyi.serviceItem.controller;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.serviceItem.domain.dto.IncomeExpenseDTO;
import com.ruoyi.serviceItem.service.IncomeExpenseRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/incomeExpense")
public class IncomeExpenseRecordController {
    @Autowired
    private IncomeExpenseRecordService incomeExpenseRecordService;

    @GetMapping("/{storeId}")
    public R getIncomeExpenseList(@PathVariable Long storeId) {
        List<IncomeExpenseDTO> records = incomeExpenseRecordService.getIncomeExpenseByStoreId(storeId);
        return R.ok(records);
    }
}
